# MIPI Camera ***Copyright © Quectel Wireless Solutions Co., Ltd. 2026. All rights reserved.*** --- This document describes in detail how to identify and connect the **MIPI CSI** camera interfaces on the **Quectel Pi M1/L1** smart main control board. It also provides functional usage guidance and troubleshooting solutions for common issues. ## Supported Accessories The **FPC** ribbon cable of the original accessory is not connected to the camera by default and must be connected manually. When connecting it, make sure the gold fingers of the ribbon cable face the metal contact surface inside the board connector, meaning the gold-finger side faces downward. Avoid incorrect cable insertion, as this may damage the camera. After connecting the ribbon cable, the camera appears as shown below: **IMX 219:** ```{image} images/image_X6bIbVhoNolDw8xtLfGcGjZKnah.webp :width: 1053px :height: 549px :align: center ```
IMX 219 camera appearance
**IMX 477:** ```{image} images/image_VbHtb3jeYoI1toxiDT1cA7Gvn1c.webp :width: 1269px :height: 648px :align: center ```
IMX 477 camera appearance
## Hardware Interface The **Quectel Pi M1/L1** smart main control board supports two **MIPI CSI** camera interfaces. The interface locations and labels are shown below: **M1 camera** interface: ```{image} images/image_ESDJbRiPHo2dHxxUzaccATsgn6d.webp :width: 1359px :height: 888px :align: center ```
M1 camera interface location
**L1 camera** interface: ```{image} images/image_AA6jbAkaZocA0xxC38jc98dgnlf.webp :width: 1021px :height: 653px :align: center ```
L1 camera interface location
## Quick Start 1. Connect the camera as shown below. The two supported camera accessories can be connected to camera1/camera2 as needed. When connecting, lift the black latch of the connector, insert the **FPC** ribbon cable into the **CSI** slot, and make sure the cable's gold fingers face the metal contact surface inside the board connector (the white side). Press the latch down and confirm that the **FPC** ribbon cable is secure and not loose. **M1** is used as an example below to show the connection methods for the **IMX 219** and **IMX 477** cameras. The L1 connection method is the same. ```{image} images/image_AzkgbbLwrol4XzxIhgxcC5Konbe.webp :width: 940px :height: 301px :align: center ```
IMX 219 connected to M1 camera2
```{image} images/image_F95jbREsTojykgxUhmWceeqwnGh.webp :width: 753px :height: 294px :align: center ```
IMX 477 connected to M1 camera2
2. Refer to [Display Configuration](<../../../Operating System/Android/Display Configuration/Display Configuration.md>) to connect the display. ## M1 Functional Usage (GNOME) Prerequisites: Before using the camera function, enter the following commands in the terminal: ```bash bash a=`find /run/user -maxdepth 2 -name 'wayland-?' 2>/dev/null`; export XDG_RUNTIME_DIR=`dirname $a` export WAYLAND_DISPLAY=`basename $a` export LD_PRELOAD=/opt/qcom/lib/libgbm.so:$LD_PRELOAD ``` ### Preview 1. Run the following command in the device terminal: ```bash gst-launch-1.0 -e qtiqmmfsrc name=camsrc ! 'video/x-raw,format=NV12,width=1280,height=720,framerate=30/1' ! waylandsink ``` 2. This command starts the camera with a 720p 30 FPS configuration and sends the image to the display for preview. If the GStreamer pipeline state changes to “PLAYING”, the camera is running. 3. If two cameras are inserted into the two CSI slots at the same time, use camera=0/1 to distinguish them. camera=0 represents the first CSI slot, and camera=1 represents the second CSI slot. For example, to open the camera in the second CSI slot, enter the following command: ```bash gst-launch-1.0 qtiqmmfsrc camera=0 ! 'video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1' ! waylandsink ``` 4. To stop the camera stream, press CTRL+C. ```{image} images/image_NRi1bJmOkoOUGTxfrIxcJzBCnqh.webp :width: 1280px :height: 800px :align: center ```
GNOME desktop camera interface
### Video Recording 1. Run the following command in the device terminal: ```bash gst-launch-1.0 -e qtiqmmfsrc camera=0 \ ! video/x-raw,format=NV12,width=1280,height=720,framerate=30/1 \ ! qtic2venc ! h264parse ! mp4mux ! filesink location=/tmp/video.mp4 ``` 1. This command starts the camera with a 720p 30 FPS configuration, encodes the stream as H.264 video, and saves it as a video file. If the GStreamer pipeline state changes to “PLAYING”, the camera is running. 2. The MP4 file is saved under /tmp/. 3. To stop camera recording, press CTRL+C. 4. You can play the video file with the following command: ```bash gst-launch-1.0 filesrc location=/tmp/video.mp4 ! qtdemux name=demux demux.video_0 ! h264parse ! avdec_h264 ! videoconvert ! waylandsink ``` ### Photo Capture 1. Run the following command in the device terminal: ```bash timeout 2 gst-launch-1.0 -e qtiqmmfsrc camera=0 \ ! video/x-raw,format=NV12,width=1920,height=1080 \ ! jpegenc ! multifilesink location=/tmp/photo_%d.jpg max-files=1 ``` 2. This command starts the camera with a 1080p 30 FPS configuration, captures an image after a 2-second delay, encodes it as a JPEG image, and saves it as an image file. If the GStreamer pipeline state changes to “PLAYING”, the camera is running. 3. The image file is saved under /tmp/. 4. You can view the image file with the following command: ```bash gst-launch-1.0 filesrc location=/tmp/photo_20.jpg ! jpegdec ! imagefreeze ! waylandsink ``` ### Dual-Camera Usage If two cameras are connected and you want to use them at the same time, refer to the following method. 1. Run the following command in the device terminal: ```bash gst-launch-1.0 \ compositor name=comp \ sink_0::xpos=0 sink_0::ypos=0 \ sink_1::xpos=0 sink_1::ypos=720 \ ! video/x-raw,width=1280,height=1440 ! waylandsink \ qtiqmmfsrc camera=0 ! video/x-raw,format=NV12,width=1280,height=720 ! comp.sink_0 \ qtiqmmfsrc camera=1 ! video/x-raw,format=NV12,width=1280,height=720 ! comp.sink_1 ``` 2. This command starts the cameras with a 720p 30 FPS configuration and previews both camera images at the same time. 3. To use picture-in-picture mode, run the following command in the terminal: ```bash gst-launch-1.0 \ compositor name=mix \ sink_0::xpos=0 sink_0::ypos=0 \ sink_1::xpos=640 sink_1::ypos=240 \ ! queue max-size-buffers=3 ! videoconvert ! waylandsink sync=false \ qtiqmmfsrc camera=0 ! 'video/x-raw,format=NV12,width=1280,height=720,framerate=15/1' ! queue ! mix.sink_0 \ qtiqmmfsrc camera=1 ! 'video/x-raw,format=NV12,width=640,height=480,framerate=10/1' ! queue ! mix.sink_1 ``` 4. To stop camera recording, press CTRL+C. ## M1/L1 Functional Usage (Weston) Prerequisites: Before using the camera function, enter the following commands in the terminal: ```bash bash a=`find /run/user -maxdepth 2 -name 'wayland-?' 2>/dev/null`; export XDG_RUNTIME_DIR=`dirname $a` export WAYLAND_DISPLAY=`basename $a` export LD_PRELOAD=/opt/qcom/lib/libgbm.so:$LD_PRELOAD ``` ### Preview 1. Run the following command in the device terminal: ```bash gst-launch-1.0 -e qtiqmmfsrc name=camsrc ! 'video/x-raw,format=NV12,width=1280,height=720,framerate=30/1' ! waylandsink ``` 2. This command starts the camera with a 720p 30 FPS configuration. You can adjust the resolution according to your needs. The image is sent to the display for preview. If the GStreamer pipeline state changes to “PLAYING”, the camera is running. 3. If two cameras are inserted into the two CSI slots at the same time, use camera=0/1 to distinguish them. camera=0 represents the first CSI slot, and camera=1 represents the second CSI slot. For example, to open the camera in the second CSI slot, enter the following command: ```bash gst-launch-1.0 qtiqmmfsrc camera=0 ! 'video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1' ! waylandsink ``` 4. To stop the camera stream, press CTRL+C. ```{image} images/image_SpOEbq7GJowH93xuYq1c5uWFnSh.webp :width: 1280px :height: 800px :align: center ```
Weston desktop camera interface
### Video Recording 1. Run the following command in the device terminal: ```bash gst-launch-1.0 -e qtiqmmfsrc camera=0 \ ! video/x-raw,format=NV12,width=1280,height=720,framerate=30/1 \ ! qtic2venc ! h264parse ! mp4mux ! filesink location=/tmp/video.mp4 ``` 2. This command starts the camera with a 720p 30 FPS configuration, encodes the stream as H.264 video, and saves it as a video file. If the GStreamer pipeline state changes to “PLAYING”, the camera is running. 3. The MP4 file is saved under /tmp/. 4. To stop camera recording, press CTRL+C. 5. You can play the video file with the following command: ```bash gst-launch-1.0 filesrc location=/tmp/video.mp4 ! qtdemux name=demux demux.video_0 ! h264parse ! avdec_h264 ! videoconvert ! waylandsink ``` ### Photo Capture 1. Run the following command in the device terminal: ```bash timeout 2 gst-launch-1.0 -e qtiqmmfsrc camera=0 \ ! video/x-raw,format=NV12,width=1920,height=1080 \ ! jpegenc ! multifilesink location=/tmp/photo_%d.jpg max-files=1 ``` 2. This command starts the camera with a 1080p 30 FPS configuration, captures an image after a 2-second delay, encodes it as a JPEG image, and saves it as an image file. If the GStreamer pipeline state changes to “PLAYING”, the camera is running. 3. The image file is saved under /tmp/. 4. You can view the newly generated image file with the following command. For example, the generated image name in this example is photo_20.jpg: ```bash gst-launch-1.0 filesrc location=/tmp/photo_20.jpg ! jpegdec ! imagefreeze ! waylandsink ``` ### Dual-Camera Usage If two cameras are connected and you want to use them at the same time, refer to the following method. 1. Run the following command in the device terminal: ```bash gst-launch-1.0 \ compositor name=comp \ sink_0::xpos=0 sink_0::ypos=0 \ sink_1::xpos=0 sink_1::ypos=720 \ ! video/x-raw,width=1280,height=1440 ! waylandsink \ qtiqmmfsrc camera=0 ! video/x-raw,format=NV12,width=1280,height=720 ! comp.sink_0 \ qtiqmmfsrc camera=1 ! video/x-raw,format=NV12,width=1280,height=720 ! comp.sink_1 ``` 2. This command starts the cameras with a 720p 30 FPS configuration and previews both camera images at the same time. 3. To use picture-in-picture mode, run the following command in the terminal: ```bash gst-launch-1.0 \ compositor name=mix \ sink_0::xpos=0 sink_0::ypos=0 \ sink_1::xpos=640 sink_1::ypos=240 \ ! queue max-size-buffers=3 ! videoconvert ! waylandsink sync=false \ qtiqmmfsrc camera=0 ! 'video/x-raw,format=NV12,width=1280,height=720,framerate=15/1' ! queue ! mix.sink_0 \ qtiqmmfsrc camera=1 ! 'video/x-raw,format=NV12,width=640,height=480,framerate=10/1' ! queue ! mix.sink_1 ``` 4. To stop camera recording, press CTRL+C.